package blacklist_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 黑名单-重点车黑名单操作
type blacklistMajorOperationType int

var BlacklistMajorOperationType blacklistMajorOperationType

// 加入黑名单
func (c *blacklistMajorOperationType) Add() int {
	return 1
}

// 移除黑名单
func (c *blacklistMajorOperationType) Move() int {
	return 2
}

func (c *blacklistMajorOperationType) ToText(value int) string {
	switch value {

	case 1:
		return "加入黑名单"

	case 2:
		return "移除黑名单"

	}
	return ""
}

func (c *blacklistMajorOperationType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *blacklistMajorOperationType) ToValue(text string) int {
	switch text {

	case "加入黑名单":
		return 1

	case "移除黑名单":
		return 2

	}
	return 0
}
